/*
*  Impp - Instant Messenger
*
*  Copyright (C) 2008  Oliver Schneider
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
#ifndef GROUPTREEITEM_H_
#define GROUPTREEITEM_H_

#include <vector>
#include "TreeItem.h"
#include "../../core/Group.h"
#include "BuddyTreeItem.h"
#include "BuddyTreeList.h"

namespace Impp {

class BuddyTreeList;

class GroupTreeItem : public TreeItem
{
private:
	Group* group;
	std::vector<TreeItem*> children;
	bool extended;

public:
	GroupTreeItem(Group* group);
	virtual ~GroupTreeItem();

	std::vector<TreeItem*> getChildren();
	void addChild(TreeItem* item);
	void removeChild(TreeItem* item);
	bool isExtended();
	void setExtended(bool extended);
	void sort();
	void paint(wxGCDC & dc, const wxPoint& pos, const wxSize& size,  BuddyPriority priority, size_t hiddenCount, BuddyTreeList* list);
	Group* getGroup();
	BuddyTreeItem* getChild(Buddy* buddy);
	size_t getSize();

public:
	static bool cmp(TreeItem* a, TreeItem* b);
};

}

#endif /*GROUPTREEITEM_H_*/
